import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/Login.vue'
import LayoutView from '@/views/Layout.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      children: [
        {
          path: '/dashboard',
          name: 'dashboard',
          component: () => import('@/views/DashBoard.vue'),
        },
        {
          path: '/interfaceManage',
          name: 'interfaceManage',
          component: () => import('@/views/InterfaceManage.vue'),
        },
        {
          path:'/interfaceManage/add',
          name:'interfaceAdd',
          component:()=>import('@/views/InterfaceEdit.vue')
        },
        {
          path:'/interfaceManage/edit',
          name:'interfaceEdit',
          component:()=>import('@/views/InterfaceEdit.vue')
        },
        {
          path: '/caseManage',
          name: 'caseManage',
          component: () => import('@/views/CaseManage.vue'),
        },
        {
          path: '/suiteManage',
          name: 'suiteManage',
          component: () => import('@/views/SuiteManage.vue'),
        },
        {
          path: '/report',
          name: 'report',
          component: () => import('@/views/Report.vue'),
        },
        {
          path: '/sysManage',
          name: 'sysManage',
          component: () => import('@/views/SysManage.vue'),
        },
      ],
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: LoginView,
    },
  ],
})

export default router
